﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Parylene_CVD.Service
{
    public class BoolToImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool boolValue)
            {
                // 根据布尔值返回不同的图片路径
                string imagePath = boolValue ? "pack://application:,,,/Images/Green.png" : "pack://application:,,,/Images/red.png";

                return imagePath;  // 使用pack URI来引用资源
            }

            return "pack://application:,,,/Images/red.png";  // 默认图片
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }




}
